﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using ChoDiaOc_HK_WPF.Views;
using System.Threading;
using System.Globalization;
using System.IO;

namespace ChoDiaOc_HK_WPF {
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application {

        private static ManHinhChinh manHinhChinh = null;

        public static ManHinhChinh ManHinhChinh {
            get { return App.manHinhChinh; }
            set {
                if (manHinhChinh == null) {
                    App.manHinhChinh = value;
                }
            }
        }

        private static ManHinhTiepNhanDangKy manHinhTiepNhanDangKy;

        public static ManHinhTiepNhanDangKy ManHinhTiepNhanDangKy {
            get { return App.manHinhTiepNhanDangKy; }
            set {
                if (manHinhTiepNhanDangKy == null) {
                    App.manHinhTiepNhanDangKy = value;
                }
            }
        }

        private static ManHinhQuanLy manHinhQuanLy;

        public static ManHinhQuanLy ManHinhQuanLy {
            get { return App.manHinhQuanLy; }
            set {
                if (manHinhQuanLy == null) {
                    App.manHinhQuanLy = value;
                }
            }
        }

        private static ManHinhChupAnh manHinhChupAnh;

        public static ManHinhChupAnh ManHinhChupAnh {
            get { return App.manHinhChupAnh; }
            set {
                if (manHinhChupAnh == null) {
                    App.manHinhChupAnh = value;
                }
            }
        }

        private static ManHinhBaoBieu manHinhBaoBieu;

        public static ManHinhBaoBieu ManHinhBaoBieu {
            get { return App.manHinhBaoBieu; }
            set {
                if (manHinhBaoBieu == null) {
                    App.manHinhBaoBieu = value;
                }
            }
        }

        public App() {
            Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose;
            Thread.CurrentThread.CurrentCulture = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone();
            Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy";

            // AnhChupFolder
            DirectoryInfo directory = new DirectoryInfo("./AnhChupDiaOc");
            if (!directory.Exists) {
                directory.Create();
            } 


        }

    }
}
